package com.huifenqi.saas.service;

import com.huifenqi.model.User;
import com.huifenqi.tookit.GuavaCacheUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author lisheng
 * @description
 * @date 2018/11/2 20:13
 * @version:
 */
@Slf4j
@Service
public class UserService {


    public void upsert(User user) {
        GuavaCacheUtil.put(String.format("%s-%d", "user", user.getId()), user);
    }


    public User get(Integer id) {
        return GuavaCacheUtil.<User>get(String.format("%s-%d", "user", id));
    }

}
